# Create your views here.

#from django.http import HttpResponse
from django.shortcuts import render_to_response
from menu import MainLoggedIn, MainLoggedOut

def index(request):
    #if request.user.is_authenticated():
    #    return HttpResponse("authenticated")
    #else:
    #    return HttpResponse("not authenticated")
    
    if request.user.is_authenticated():
        menu = MainLoggedIn
        print " index : auth as ", request.user.username, " " # , request.user.get_profile().role
    else:
        menu = MainLoggedOut
        print " index : anonymous"
    
    c = {'user' : request.user,
         'menu' : menu,
         'template_menu' : 'menu.html'}
    
    return render_to_response("index.html", c)
